<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>使用Animate.css库</title>
    <link rel="stylesheet" href="css/animate.css">
</head>

<body>
    <div id="root">
        <!-- 添加动画效果 -->
        <transition 
            enter-active-class="animated jello"
            leave-active-class="animated wobble"
            >
            <div v-if="show">hello world</div>
        </transition>
        
        <button @click="handleClick">toggle</button>

        <!-- <div class="animated" v-bind:class="{ 'jello': show, 'wobble': !show}">世界你好</div> -->

    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        var vm = new Vue({
            el: "#root",
            data: {
                show: false
            },
            methods: {
                handleClick: function () {
                    this.show = !this.show;
                }
            }
        })
    </script>
</body>

</html>